# -*- coding: utf-8 -*-
# @Time    : 2025/2/26 10:15
# @Author  : cx
# @File    : main.py
# @Software: PyCharm

from lxml import etree  # 解析HTML代码
import requests

#字符编码处理
import chardet
import re

import XiaoShuoPaQu
from xhytd import XHYTD


def bao_cun(neiRong, filename):
    try:
        with open(filename, 'a', encoding='utf-8') as f:
            f.write(neiRong + '\n\n')  # 添加两个换行作为章节分隔
            return True
    except PermissionError:
        print(f"错误：文件 {filename} 被其   他程序占用")
        return False
    except Exception as e:
        print(f"未知错误：{str(e)}")
        return False




if __name__ == '__main__':
    dd = XHYTD()
    #pd = dd.setCanShu("http://www.xh.com/153/153793/60257244.html","hhhd")
    dd.cha_zhao("我的末世列车")


